using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ProcessInfoManager
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Show();
            WindowState = FormWindowState.Normal;            
        }

        private void Form1_Resize(object sender, EventArgs e)
        {
            if (FormWindowState.Minimized == WindowState)
                Hide();
        }

        private void opToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Show();
            WindowState = FormWindowState.Normal;  
        }

        private void enToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }


        TextBoxProcessDisplayer c;
        private void Form1_Load(object sender, EventArgs e)
        {
            c = new TextBoxProcessDisplayer(new ProSysDataProducer(),textBox1);
            c.Display();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            c.OutputToFile(textBox2.Text);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            c.Display();
        }
    }
}